package io.gitee.zicai.nacos.consumer

import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.runApplication
import org.springframework.cloud.client.discovery.EnableDiscoveryClient
import org.springframework.cloud.client.loadbalancer.LoadBalanced
import org.springframework.context.annotation.Bean
import org.springframework.web.client.RestTemplate


/**
 * NacosConsumerApp
 *
 * @author zicai
 * @since 2019-01-17
 */
@EnableDiscoveryClient
@SpringBootApplication
open class NacosConsumerApp {

    companion object {

        @JvmStatic
        fun main(args: Array<String>) {
            runApplication<NacosConsumerApp>(*args)
        }
    }

    @LoadBalanced
    @Bean
    open fun restTemplate(): RestTemplate {
        return RestTemplate()
    }
}